const { sequelize, DataTypes } = require('../../utill/getSequelize');
const { T_exam_target } = require('../t_exam_target');

//课程内容表
const Class_Content = sequelize.define('Class_Content', {
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true,
  },



  unit_knowledge_name: {//单元知识表id    改了
    type: DataTypes.STRING,
    // allowNull: false,
  },

  tec_content: {//教学内容
    type: DataTypes.STRING,
    // allowNull: false,
  },

  tec_request: {//教学要求
    type: DataTypes.STRING,
    // allowNull: false,
  },


  class_target_name: {//课程目标id        改了
    type: DataTypes.STRING,
    // allowNull: false,
  },

  t_user_and_a_c_s_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
  },

  target_id: {
    type: DataTypes.INTEGER,
    // allowNull: false,
  }



});

// Class_Content.belongsTo(T_exam_target, { foreignKey: 'target_id', as: 'target' });
//同步模型和数据库表
(async () => {
  try {
    await sequelize.sync({ force: false });
    console.log('All models were synchronized successfully.');
  } catch (error) {
    console.log(error);
  }

})();

//提供出去
module.exports = { Class_Content };